Voice Recognition Project

Speech will not work on your computer by opening up the file in your web browser. You will need to upload to a web server.

Use the Chrome browser for this project.


On a 800x600 pixel canvas display, 5 words of objects. When the user says the name of the object, display that object on the canvas. You might need to find common objects, as it will help with the voice recognition.

Offer the users:
Have a button with the value of "Speak". When the user clicks on that button the value changes to "Stop"

Have your program respond to words of the objects

Have on the screen instructions that list the following, but write so it looks like instructions for a user:

Use Text to Speech to have the program speak back to the user.

When the user presses the Speak button, have the program listen and stop when the user stops speaking (which is automatic) or if they press "Stop".

Display unknown, if the object is not listed (or the speech is misunderstood).


When the user stops speaking, or pressed "Stop", change the button's value to "Speak" so that the user can speak again.
SpeechRecognition.abort()
Stops the speech recognition service from listening to incoming audio, and doesn't attempt to return a SpeechRecognitionResult.
SpeechRecognition.start()
Starts the speech recognition service listening to incoming audio with intent to recognize grammars associated with the current SpeechRecognition.
SpeechRecognition.stop()
Stops the speech recognition service from listening to incoming audio, and attempts to return a SpeechRecognitionResult using the audio captured so far.

https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onresult

Set continuous to be false, but start the recognition again, if you want to keep listening for more commands. Otherwise try the continuous feature, but I found it easier to start the recognition after it stopped.

Helpful Links:

https://shapeshed.com/html5-speech-recognition-api/
http://stephenwalther.com/archive/2015/01/05/using-html5-speech-recognition-and-text-to-speech
https://dvcs.w3.org/hg/speech-api/raw-file/9a0075d25326/speechapi.html
https://stiltsoft.com/blog/2013/05/google-chrome-how-to-use-the-web-speech-api/
https://davidwalsh.name/speech-recognition